Skip to content

Refuse to delete the built-in roles - #2607

Closed
p-hoffmann wants to merge 1 commit into
masterfrom
p-hoffmann/protect-built-in-roles
Closed

p-hoffmann wants to merge 1 commit into
masterfrom
p-hoffmann/protect-built-in-roles

Conversation

@p-hoffmann

@p-hoffmann p-hoffmann commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

DELETE /role/{id} deletes any role, including the roles the baseline creates. Nothing recreates them afterwards. The concrete breakage is for admin: the admin-login grant looks the role up by name and fails with "Role not found" once it is gone. Deleting the other built-in roles does not break code paths, but removes the permissions their members had, with no way to get the seeded role back short of SQL.

This is hardening rather than a fix of existing behaviour: the roles the baseline creates (anonymous, public, admin, concept set creator, Tag Admin, cohort creator, cohort reader, Read-restricted) can no longer be deleted, and the request gets a 400. Other roles, and personal roles that have one of these names, can still be deleted.

RemoveBuiltInRoleTest covers both cases.

@p-hoffmann p-hoffmann modified the milestone: v3.1 Dec 4, 2026
@p-hoffmann p-hoffmann closed this Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant